

# magic IDs
SAAS_MAGIC_REQ                                                    = 0x29C20FC1
SAAS_MAGIC_RESP                                                   = 0xF3D2039A

# packet types
SAAS_PKT_TYPE_PING                                                = 0x0000
SAAS_PKT_TYPE_AUTHENTICATE                                        = 0x0001
SAAS_PKT_TYPE_AUTHORISE                                           = 0x0002
SAAS_PKT_TYPE_CHANGE_PASSWORD                                     = 0x0003
SAAS_PKT_TYPE_UID_TO_USERNAME                                     = 0x0004
SAAS_PKT_TYPE_USERNAME_TO_UID                                     = 0x0005
SAAS_PKT_TYPE_GID_TO_GROUPNAME                                    = 0x0006
SAAS_PKT_TYPE_GROUPNAME_TO_GID                                    = 0x0007
SAAS_PKT_TYPE_USER_INFO_BY_UID                                    = 0x0008
SAAS_PKT_TYPE_USER_INFO_BY_USERNAME                               = 0x0009
SAAS_PKT_TYPE_USER_INFO_WITH_GROUPS_BY_UID                        = 0x000A
SAAS_PKT_TYPE_USER_INFO_WITH_GROUPS_BY_USERNAME                   = 0x000B
SAAS_PKT_TYPE_USER_INFO_WITH_ALL_GROUPS_BY_UID                    = 0x000C
SAAS_PKT_TYPE_USER_INFO_WITH_ALL_GROUPS_BY_USERNAME               = 0x000D
SAAS_PKT_TYPE_GROUP_INFO_BY_GID                                   = 0x000E
SAAS_PKT_TYPE_GROUP_INFO_BY_GROUPNAME                             = 0x000F
SAAS_PKT_TYPE_GROUP_INFO_WITH_MEMBERS_BY_GID                      = 0x0010
SAAS_PKT_TYPE_GROUP_INFO_WITH_MEMBERS_BY_GROUPNAME                = 0x0011
SAAS_PKT_TYPE_GROUP_INFO_WITH_ALL_MEMBERS_BY_GID                  = 0x0012
SAAS_PKT_TYPE_GROUP_INFO_WITH_ALL_MEMBERS_BY_GROUPNAME            = 0x0013


## error codes ahoy!
SAAS_OP_SUCCESS                                                   = 0x0000

## operation-specific errors
SAAS_OP_INVALID_PASSWORD                                          = 0x1000
SAAS_OP_USER_NOT_FOUND                                            = 0x1001
SAAS_OP_GROUP_NOT_FOUND                                           = 0x1002
SAAS_OP_USER_UNAUTHORISED                                         = 0x1003
SAAS_OP_USERNAME_TOO_LONG                                         = 0x1004

## general errors
SAAS_OP_SERVER_ERROR                                              = 0x2000
SAAS_OP_NO_HOSTS                                                  = 0x2001
SAAS_OP_DECRYPT_ERROR                                             = 0x2002
SAAS_OP_MAGIC_ERROR                                               = 0x2003
SAAS_OP_FILE_ERROR                                                = 0x2004
SAAS_OP_PAD_ERROR                                                 = 0x2005
SAAS_OP_PARSE_ERROR                                               = 0x2006
SAAS_OP_ARG_ERROR                                                 = 0x2007
SAAS_OP_MEM_ERROR                                                 = 0x2008
SAAS_OP_TIMEOUT_ERROR                                             = 0x2009
SAAS_OP_SOCKET_ERROR                                              = 0x200A
SAAS_OP_MALFORMED_REQUEST                                         = 0x200B
SAAS_OP_MALFORMED_RESPONSE                                        = 0x200C


## group membership types
SAAS_GROUP_MEMBER_TYPE_GROUP                                      = 0x00
SAAS_GROUP_MEMBER_TYPE_USER                                       = 0x01


# host types
SAAS_HOST_TYPE_DNS                                                = 0x01
SAAS_HOST_TYPE_IPV4                                               = 0x02
SAAS_HOST_TYPE_IPV6                                               = 0x03


# max packet length
SAAS_MAX_PKT_LEN                                                  = 65535


# log levels
LOG_DEBUG                                                         = 0
LOG_INFO                                                          = 1
LOG_WARNING                                                       = 2
LOG_ERR                                                           = 3


SAAS_ENC_TYPE_AES256CBC_SHA256                             = 0x00000001
SAAS_ENC_TYPE_AES256ECB_SHA256                             = 0x00000002
SAAS_ENC_TYPE_AES128CBC_SHA256XOR                          = 0x00000003
SAAS_ENC_TYPE_AES128ECB_SHA256XOR                          = 0x00000004



